var ns, UIAlbumBrowser, bmLocation;
app = new Vue({
    el: '#app',
    data: {
        ID:0,
        form: {
            RelationName:'',
            RelatePhoneNumber:''
        },
    },
    methods: {
        get_data: function () {
            var that = this;
            var options = {};
            options.action = "getusagerecorddetails";
            options.ID = that.ID;
            ns.post(options, function (succeed, data, err) {
                console.log(JSON.stringify(options));
                console.log(JSON.stringify(err));
                console.log(JSON.stringify(data));
                if (succeed) {
                    that.form=data.newModel;
                    that.form.RelationName=(data.newModel.RelationName).toString();
                    that.form.RelatePhoneNumber=(data.newModel.RelatePhoneNumber).toString();
                } else if (err) {
                    api.toast({
                        msg: err,
                        duration: 2000,
                        location: 'bottom'
                    });
                }
            }, {
                toast: true
            });
        },
        //记录详情
        do_opendetail:function(id){
            var that=this;
            ns.openWin('service_history_detail', '收款详情',{
                ID:id
            });

        },
        //手动收款
        do_openwrite:function(){
            var that=this;
            ns.openWin('service_write_add', '新增收款');
        },

    }
});
apiready = function () {
    api.parseTapmode();
    ns = window.Foresight.Util;
    app.ID = api.pageParam.ID || 0;
    app.get_data();
    api.addEventListener({
        name: 'home_new_updata'
    }, function(ret, err) {
        app.get_data();
    });

};
